# Maintainer: Will Sinatra <wpsinatra@gmail.com>
# Contributor: Will Sinatra <wpsinatra@gmail.com>
pkgname=ruby-syslog
_gemname=${pkgname#ruby-}
pkgver=0.1.2
pkgrel=0
pkgdesc="Ruby interface for the POSIX system logging facility."
url="https://rubygems.org/gems/syslog"
arch="noarch"
license="BSD"
depends="ruby"
makedepends="ruby-dev ruby-rake-compiler"
checkdepends="ruby-rake ruby-bundler ruby-test-unit"
source="$pkgname-$pkgver.tar.gz::https://github.com/ruby/syslog/archive/refs/tags/v$pkgver.tar.gz
	gemspec.patch"
builddir="$srcdir/$_gemname-$pkgver"

prepare() {
	default_prepare

	sed -i '/spec.signing_key/d' $_gemname.gemspec
}

build() {
	gem build $_gemname.gemspec
}

check() {
	rake test
}

package() {
	local gemdir="$pkgdir/$(ruby -e 'puts Gem.default_dir')"

	gem install --local \
		--install-dir "$gemdir" \
		--ignore-dependencies \
		--no-document \
		--verbose \
		$_gemname

	rm -r "$gemdir"/cache \
		"$gemdir"/build_info \
		"$gemdir"/doc
}

sha512sums="
d208dbc366fae7c8a69bfb5185c5175cc1ed11b02210ec630efc5581851193d987612429d97a8bf09be281066450b8609758de5964fbff3a21891a6214dda27a  ruby-syslog-0.1.2.tar.gz
23088d7c7832e4d5032b825e545785b49032762645232db8a70cf0c05d6d45f5e8239377af89a15a041889167375b67d79aa34d993425d4576dd783a249f6de6  gemspec.patch
"
